]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Actually throw programmer errors
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 30 Oct 2013 17:05:20 +0000 (13:05 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 30 Oct 2013 17:05:20 +0000 (13:05 -0400)
This way we get a backtrace.

js/ui/iconGrid.js

index 4801ac23b53c5c7ac4903fb3c0489002bdf9209c..64a54427fcfe3fdcb2d9499295872f791d7ee1f9 100644 (file)
@@ -423,10 +423,8 @@ const IconGrid = new Lang.Class({
     },
 
     addItem: function(item, index) {
-        if (!item.icon || !item.icon instanceof BaseIcon) {
-            log('Only items with a BaseIcon icon property can be added to IconGrid');
-            return;
-        }
+        if (!item.icon instanceof BaseIcon)
+            throw new Error('Only items with a BaseIcon icon property can be added to IconGrid');
 
         this._items.push(item);
         if (index !== undefined)